Conditinal ranking of data from lists nested in dictionarys